package com.max.xihu.patterns.proto;

/**
 * @Author: Max
 * @Date: 2020-09-09 07:49
 * @Description:
 */
public class PrototypeShape implements Cloneable{

    private String name;

    public PrototypeShape(String name) {
        System.out.println("有参构造函数被执行...");
        this.name = name;
    }

    @Override
    protected PrototypeShape clone() {
        PrototypeShape shape = null;
        try {
            shape = (PrototypeShape)super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return shape;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
